package com.xxx.userservice.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.function.Consumer;

@Slf4j
@Configuration
public class CustomConsumer {

    /**
     * 接收原始消息（函数式编程）
     */
    @Bean
    public Consumer<String> custom() {
        return str -> {
            log.info("CustomConsumer received message：" + str);
        };
    }

}
